<template>
<!--  <nav>
    <router-link to="/">Home</router-link> |
    <router-link to="/about">About</router-link>
  </nav>-->

  <el-row>
    <el-col :span="4">
      <el-menu
          default-active="1"
          class="el-menu-vertical-demo"
          active-text-color="#ffd04b"
          background-color="#545c64"
          text-color="#fff"
          style="height: 100%"
      >
        <el-sub-menu index="1">
          <template #title>
            <span>流媒体管理</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="1-3"><router-link to="/cameraStream" style="text-decoration: none;color: white">首页-摄像头</router-link></el-menu-item>
            <el-menu-item index="1-1" @click="getMenuItem" ><router-link to="/" style="text-decoration: none;color: white">摄像头详情</router-link></el-menu-item>
            <el-menu-item index="1-2"><router-link to="/exceptioninfo" style="text-decoration: none;color: white">异常报警信息</router-link></el-menu-item>
            <el-menu-item index="1-4"><router-link to="/modelmanage" style="text-decoration: none;color: white">模型管理</router-link></el-menu-item>
            <el-menu-item index="1-4"><router-link to="/userconfig" style="text-decoration: none;color: white">用户信息配置</router-link></el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>

        <el-sub-menu index="2">
          <template #title>

            <span>其他</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="2-1" @click="goPage('/exceptioninfo')">item one</el-menu-item>
            <el-menu-item index="2-2">item two</el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>
      </el-menu>
    </el-col>
    <el-col :span="20" style="height: 100%">
      <router-view/>
    </el-col>
  </el-row>
</template>

<script lang="ts" setup>
import router from "@/router";

//失败
function goPage(url:string){
  router.push({path:url})
}

</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
